home *** CD-ROM | disk | FTP | other *** search
- /* CAS.H Communicating Applications Specification header file. =============
-
- Defines structures and constants used in the Intel/DCA Communicating
- Applications Specification 1.0 Toolkit.
-
- This file must be included in any application source files that use
- functions from the CAS Toolkit.
- ==============================================================================*/
-
- typedef unsigned char BYTE;
- typedef unsigned short WORD;
- typedef unsigned long LONGWORD;
-
- /*
- CAS DATE structure: Input to CAS function CASSetTaskDate,
- Output of CAS function CASGetTaskDate.
- */
- typedef struct { /* THE FOLLOWING RANGES APPLY ONLY IF VALUES ARE NOT ALL 0 */
- WORD Year; /* only 1980 to 2099 allowed */
- BYTE Month; /* 1 - 12 */
- BYTE Day; /* must be valid day for given month/year */
- } CAS_DATE;
-
- /*
- CAS TIME structure: Input to CAS function CASSetTaskTime,
- Output of CAS function CASGetTaskTime.
- */
- typedef struct {
- BYTE Hour; /* 0 - 23 */
- BYTE Minute; /* 0 - 59 */
- BYTE Second; /* 0 - 59 */
- } CAS_TIME;
-
- #pragma pack(1) /* These CAS structures must be packed */
-
- /*
- CAS SIZE CONSTANTS
- */
- #define FNAMELENGTH 13
- #define DIRPATHLENGTH 68
- #define NAMELENGTH 32
- #define CSIDLENGTH 21
- #define PHONENUMLENGTH 47
- #define APPTAGLENGTH 64
- #define FULLFNAMELENGTH 80
- #define RESERVED2LENGTH 78
- #define FTRRESERVED 31
-
- /*
- EXTERNAL DATA BLOCK structure: Output of CAS function CASGetExternalData.
- */
- typedef struct {
- BYTE CASMajorVer; /* CAS major version number */
- BYTE CASMinorVer; /* CAS minor version number */
- char DefaultDir[DIRPATHLENGTH]; /* Path to Comm software */
- char DefaultPhonebook[FNAMELENGTH]; /* Phone book file name */
- char DefaultLogo[FNAMELENGTH]; /* Logo file name */
- char DefaultSender[NAMELENGTH]; /* Specified by installer */
- char CSID[CSIDLENGTH]; /* CCITT identification */
- BYTE RESERVED[107]; /* Reserved for Intel use */
- } EDB;
-
- /*
- SINGLE FILE TRANSFER RECORD structure: The fixed part of the input to CAS
- function CASSubmitSingleFile. The variable part is the cover page text.
- Append a buffer containing the cover page text to this structure,
- starting at the last field.
- */
- typedef struct {
- BYTE TransferType; /* Type of transfer (file, fax etc) */
- BYTE TextSize; /* 0: 80colx66lin, 1: 132colx88lin */
- WORD EventTime; /* Time to send in DOS packed format */
- WORD EventDate; /* Date to send in DOS packed format */
- char DestinationName[NAMELENGTH]; /* To: field */
- char FileName[FULLFNAMELENGTH]; /* Path name of this file */
- char Phone[PHONENUMLENGTH]; /* Phone # to call */
- char ApplicationTag[APPTAGLENGTH];/* Application specific tag field */
- char RESERVED1; /* Reserved for Intel use */
- BYTE SendCover; /* 1:Send, 0:Don't send cover page */
- BYTE RESERVED2[23]; /* Reserved for Intel use */
- char CoverTextDummy; /* Marks start of the Covertext */
- } SFTR;
-
- /*
- EVENT CONTROL FILE structure: The FIXED part of the CAS specification for
- a Control File. (The variable parts are the cover page text and the
- File Transfer Records.)
-
- The path and name of a disk file consisting of this structure plus the
- cover page and the File Transfer Records is the input to the CAS
- function CASSubmitTask.
-
- This structure is also the output of the high-level Toolkit function
- CCPGetEventControlInfo.
- */
- typedef struct {
- BYTE EventType; /* Type of event (send, receive etc) */
- BYTE TransferType; /* Type of transfer (file, fax etc) */
- int EventStatus; /* Status of event */
- WORD EventTime; /* Time to send or time received */
- WORD EventDate; /* Date to send or date received */
- int FileCount; /* Number of files to transfer */
- WORD FTROffset; /* Offset of 1st FTR in TCF on disk */
- char Phone[PHONENUMLENGTH]; /* [0-9] and [,!PTM*#] have meaning */
- char ApplicationTag[APPTAGLENGTH];/* Application specific tag field */
- BYTE RESERVED1; /* Reserved for Intel use */
- BYTE ConnectSeconds; /* Time of connection: seconds */
- BYTE ConnectMinutes; /* Time of connection: minutes */
- BYTE ConnectHours; /* Time of connection: hours */
- LONGWORD TotalPages; /* Total # of pages in all files */
- LONGWORD PagesSent; /* # of pages transmitted so far */
- WORD FilesSent; /* # of files transmitted so far */
- BYTE SendCover; /* 1:Send/0:don't send cover page */
- WORD ErrorCount; /* Total # of tranmission errors */
- BYTE RESERVED2[RESERVED2LENGTH]; /* Reserved for Intel use */
- char RemoteCSID[CSIDLENGTH]; /* Remote CCITT identification */
- char DestinationName[NAMELENGTH]; /* To: field */
- char SenderName[NAMELENGTH]; /* From: field */
- char LogoFilePath[FULLFNAMELENGTH];/* Path to logo file that is sent */
- } ECF;
-
- /*
- FILE TRANSFER RECORD structure: One or more of these are a part of the
- CAS Control File. The path and name of this file is the input to the
- CAS function CASSubmitTask.
-
- One of these structures representing the file currently being
- transferred is part of the output structure of the CAS function
- CASGetCurrentEventStatus.
-
- A linked list of one or more structures containing this structure is
- the output of the high-level Toolkit function CASGetEventFileInfo.
- */
- typedef struct {
- BYTE FileType; /* Type of file (ASCII, PCX, DCX) */
- BYTE TextSize; /* 0: 80colx66lin, 1: 132colx88lin */
- BYTE FileStatus; /* Status of file (opened, moved etc) */
- LONGWORD BytesSent; /* Bytes transmitted so far */
- LONGWORD FileSize; /* Size of file in bytes */
- WORD PagesSent; /* Pages transmitted so far */
- WORD PageCount; /* # of pages in this file */
- char FileName[FULLFNAMELENGTH]; /* Path name of this file */
- BYTE AddPageIncrements; /* Additional 1/8 inch increments */
- char PageLength; /* Page length in inches */
- char RESERVED[FTRRESERVED]; /* Reserved for Intel use */
- } FTR;
-
- /*
- CURRENT EVENT CONTROL structure: Output of the CAS function
- CASGetCurrentEventStatus.
- */
- typedef struct {
- ECF ControlFile; /* Control file of current event */
- FTR CurrentFileInTransit; /* The FTR controlling the current file
- transfer */
- } CECS;
-
- /*
- QUEUE STATUS structure: Output of the CAS function CASGetQueueStatus.
- */
- typedef struct {
- int QChanges; /* # of changes since CCAM installed */
- int QControlFiles; /* Current # of control files in queue*/
- int QReceivedFiles; /* Current # of received files */
- } QSTAT;
-
- /*
- HARDWARE STATUS structure: Output of the CAS function
- CASGetHardwareStatus.
- */
- typedef struct {
- BYTE TransmissionStatus; /* bit fields for transmission status */
- int RESERVED1; /* reserved field */
- BYTE RetriesLeft; /* number of retries left */
- BYTE RESERVED2; /* reserved field */
- BYTE PhoneLineStatus; /* bit fields for phone line status */
- BYTE BaudRateStatus; /* bit fields for baud rate status */
- char RESERVED3[3]; /* reserved field */
- BYTE HardwareStatus1; /* additional status bit fields */
- BYTE ComIOPorts; /* bit fields for I/O and COM ports */
- BYTE HardwareStatus2; /* additional status bit fields */
- char RESERVED4; /* reserved field */
- WORD ErrorCount; /* receiving/transmission errors */
- char RESERVED5[14]; /* reserved field */
- char RemoteCSID[CSIDLENGTH]; /* CSID of the remote hardware */
- char RESERVED6[77]; /* reserved field */
- } HWSTAT;
-
- /* Data file header id values - used in graphic data files (PCX & DCX). */
- #define PCXID 0x0A /* Id byte value for PCX files. */
- #define PCXENCODE 1 /* Encoding method for PCX files. */
- #define DCXID 987654321 /* Id word value for DCX files. */
-
- /*
- PCX FILE HEADER structure: No current Toolkit functions use this
- structure. It would be useful for any functions that manipulate or
- process PCX-format graphics files.
- */
- typedef struct {
- BYTE PCXid; /* Must be 0AH */
- BYTE Version; /* 2 suggested; 2 or more allowed */
- BYTE EncodingMethod; /* Must be 1 */
- BYTE BitsPerPixel; /* Must be 1 for Fax Mode transfer */
- WORD xMinPos; /* X position of upper left corner,
- usually 0 */
- WORD yMinPos; /* Y position of upper left corner,
- usually 0 */
- WORD xMaxPos; /* X position of bottom right corner,
- maximum 1728. xMaxPos - xMinPos + 1
- must be a multiple of 8 */
- WORD yMaxPos; /* Y position of bottom right corner,
- 2200 recommended maximum. */
- WORD HResolution; /* Display card horizontal resolution,
- ignored in Fax mode. 640
- recommended */
- WORD VResolution; /* Display card vertical resolution,
- ignored in Fax mode. 200
- recommended */
- BYTE Palette[48]; /* Ignored in Fax mode; set to 0 */
- BYTE Reserved1; /* Must be 0 */
- BYTE ColorPlanes; /* Must be 1 for Fax mode */
- WORD HorizLineBytes; /* Horizontal line width in bytes */
- char Reserved2[60]; /* Should be 0. */
- } PCXFILE;
-
- /*
- DCX FILE structure: No current Toolkit functions use this structure. It
- would be useful for any functions that manipulate or process DCX-format
- graphics files.
- */
- typedef struct {
- LONGWORD DCXid; /* Always 987,654,321 */
- LONGWORD *PageOffsets; /* Variable-length array of 4-byte
- offsets, NULL-terminated */
- } DCXFILE;
-
- #pragma pack() /* end of packed CAS structures */
-
- /* CAS CONSTANTS */
-
- /* CONTROL FILE STRUCTURE CONSTANTS */
-
- /* EventType constants */
- #define SEND 0 /* Immediate send event */
- #define RECEIVE 1 /* Immediate receive event */
- #define POLLED_SEND 2 /* Polled send event */
- #define POLLED_RECEIVE 3 /* Polled receive event */
-
- /* TransferType constants */
- #define FAX_200 0 /* 200x200 dpi fax mode */
- #define FAX_100 1 /* 100x100 dpi fax mode */
- #define FILE_TRANSFER 2 /* File transfer mode */
-
- /* CASFindFirst and CASFindNext constants */
- #define NO_MORE_EVENTS 0x204 /* No (more) events in the queue */
- #define ANY_STATUS -1 /* Search for event with any status */
-
- /* EventStatus constants */
- #define COMPLETED 0 /* Event was successfully completed */
- #define WAITING 1 /* Waiting to be processed */
- #define DIALED 2 /* Number has been dialed */
- #define SENDING 3 /* Connection made -- sending */
- #define RECEIVING 4 /* Connection made -- receiving */
- #define ABORTED 5 /* Event was aborted */
- #define NEW_STATUS 6 /* Event has not been viewed before */
-
- /* CoverPage constants */
- #define NO_COVER 0 /* Do NOT send cover page */
- #define COVER 1 /* Send cover page */
-
- /* FILE TRANSFER RECORD CONSTANTS */
-
- /* FileType constants */
- #define ASCII 0 /* ASCII file */
- #define PCX 1 /* PCX encoded graphics page */
- #define DCX 2 /* PCX encoded graphics document */
-
- /* TextSize constants */
- #define NORMAL 0 /* 80 columns by 66 lines */
- #define SMALL 1 /* 132 columns by 88 lines */
-
- /* FileStatus constants */
- #define UNTOUCHED 0 /* File has not been modified */
- #define OPENED 1 /* File has been opened */
- #define MOVED 2 /* File has been moved */
- #define DELETED 3 /* File was deleted */
- #define NOT_RECEIVED 4 /* File is not yet received */
-
- /* CAS TOOLKIT LOW-LEVEL FUNCTION INTERNAL CONSTANTS */
-
- /* CAS Function Numbers */
- #define INSTALLEDSTATE 0x00 /* CASGetInstalledState */
- #define SUBMITTASK 0x01 /* CASSubmitTask */
- #define ABORTCURRENT 0x02 /* CASAbortCurrentEvent */
- #define FINDFIRST 0x05 /* CASFindFirst */
- #define FINDNEXT 0x06 /* CASFindNext */
- #define OPENFILE 0x07 /* CASOpenTaskFile */
- #define DELETEFILE 0x08 /* CASDeleteFile */
- #define DELETEALL 0x09 /* CASDeleteAllFiles */
- #define GETEVENTDATE 0x0A /* CASGetEventDate */
- #define SETEVENTDATE 0x0B /* CASSetEventDate */
- #define GETEVENTTIME 0x0C /* CASGetEventTime */
- #define SETEVENTTIME 0x0D /* CASSetEventTime */
- #define GETEDB 0x0E /* CASGetExternalData */
- #define AUTORCVSTATE 0x0F /* CASARState */
- #define GETEVENTSTATUS 0x10 /* CASGetEventStatus */
- #define GETQUEUESTATUS 0x11 /* CASGetQueueStatus */
- #define GETHWSTATUS 0x12 /* CASGetHardwareStatus */
- #define RUNDIAGNOSTICS 0x13 /* CASRunDiagnostics */
- #define MOVEFILE 0x14 /* CASMoveReceivedFile */
- #define SUBMITSINGLE 0x15 /* CASSubmitSingleFile */
- #define UNINSTALL 0x16 /* CASUninstall */
-
- /* Needed for calls to the Resident Manager. */
- #define CASCALL 0x2F /* Resident Manager Interrupt vector */
- #define MULTIPLEX 0xCB /* Default Multiplex number */
-
- /* CONSTANTS FOR USING CAS TOOLKIT LOW-LEVEL FUNCTIONS */
-
- /* Search direction specifiers for CASFindFirst & CASFindNext. */
- #define SEARCH_FORWARD 0 /* Search forward chronologically */
- #define SEARCH_BACKWARD 1 /* Search backward chronologically */
-
- /* Used to specify the Queue to take action on. Used in various CAS calls. */
- #define TASK_QUEUE 0 /* Take action on Task Queue */
- #define RECEIVE_QUEUE 1 /* Take action on Receive Queue */
- #define LOG_QUEUE 2 /* Take action on Log Queue */
- #define UNKNOWN_QUEUE 255 /* Don't know which Queue to use */
-
- /* Used to specify whether to START or STATUS diagnostics in CASRunDiagnostics. */
- #define START 1 /* Start diagnostics running */
- #define STATUS 0 /* Report status without waiting */
-
- /* Used to specify whether to GET or SET in CASAutoReceiveState. */
- #define GET 0 /* Get Autoreceive state */
- #define SET 1 /* Set Autoreceive state */
-
- /* Auto Receive State modes. */
- #define AR_OFF 0 /* Hardware is not set to Autoreceive */
- #define AR_ON 1 /* Hardware is set to Autoreceive */
-
- /* Used to tell Resident Manager installation status in CASGetInstalledState. */
- #define NOTiOK 0 /* Not installed, OK to install */
- #define NOTiNO 1 /* Not installed, NOT OK to install */
- #define INSTALLED 0xFF /* Resident Manager is installed */
-
- /* CAS TOOLKIT LOW-LEVEL FUNCTION PROTOTYPES */
- extern int pascal CASGetInstalledState(void);
- extern int pascal CASSubmitTask(char *filespec);
- extern int pascal CASAbortCurrentEvent(void);
- extern int pascal CASFindFirst(int status, BYTE direction, BYTE queue);
- extern int pascal CASFindNext(BYTE queue);
- extern int pascal CASOpenFile(int handle, int file, BYTE queue);
- extern int pascal CASDeleteFile(int handle, int file, BYTE queue);
- extern int pascal CASDeleteAllFiles(BYTE queue);
- extern int pascal CASGetEventDate(int handle, BYTE queue, CAS_DATE *date);
- extern int pascal CASSetTaskDate(int handle, CAS_DATE *date);
- extern int pascal CASGetEventTime(int handle, BYTE queue, CAS_TIME *time);
- extern int pascal CASSetTaskTime(int handle, CAS_TIME *time);
- extern int pascal CASGetExternalData(EDB *buffer);
- extern int pascal CASAutoReceiveState(BYTE mode, BYTE *rings);
- extern int pascal CASGetCurrentEventStatus(CECS *buffer);
- extern int pascal CASGetQueueStatus(BYTE queue, QSTAT *buffer);
- extern int pascal CASGetHardwareStatus(HWSTAT *buffer);
- extern int pascal CASRunDiagnostics(BYTE mode);
- extern int pascal CASMoveReceivedFile(int handle, int file, char *filespec);
- extern int pascal CASSubmitSingleFile(SFTR *buffer);
- extern int pascal CASUnloadResidentManager(void);